package com.data.model.sqlclause.where.basic;

import com.data.model.sqlclause.where.exprssion.AndExpression;
import com.data.model.sqlclause.where.exprssion.OrExpression;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public abstract class Expression {
    public abstract String getType();

    public Expression and(Expression a) {
        List<Expression> list = new ArrayList<>(Arrays.asList(this, a));
        AndExpression andExpression = new AndExpression();
        andExpression.setExpressions(list);
        return andExpression;
    }

    public Expression or(Expression a) {
        List<Expression> list = new ArrayList<>(Arrays.asList(this, a));
        OrExpression orExpression = new OrExpression();
        orExpression.setExpressions(list);
        return orExpression;
    }
}
